package dmqm.mall.controller;

import dmqm.mall.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/mall")
public class ViewController {
    @Autowired
    private ProductService productService;

    @RequestMapping("/index")
    public String index(Model m) {
        m.addAttribute("list", productService.List());
        return "index";
    }
}
